import fly from './fly'

export function list (params) {
  return fly.get('orders', params)
}

export function show (id) {
  return fly.get('orders/' + id)
}

export function store (data) {
  return fly.post('orders', data)
}

export function submitOrder (data) {
  return fly.post('orders/' + data.order_id + '/submit', data)
}
export function submitGroupOrder (params) {
  return fly.post('orders/store-from-group-buy', params)
}

export function updateCustomerMessage (id, params) {
  return fly.post('/orders/' + id + '/update-customer-message', params)
}

export function pay (id) {
  return fly.post('orders/' + id + '/pay?_mp=true')
}

export function storeFromCart (data) {
  return fly.post('orders/store-from-cart', data)
}

export function cancel (id) {
  return fly.post('orders/' + id + '/cancel')
}

export function confirmReceipt (id) {
  return fly.post('orders/' + id + '/confirm-receipt')
}

export function applyRoe (id, data) {
  return fly.post('orders/' + id + '/apply-roe', data)
}
